interface Department {
  id: number;
  parentDepartmentId: number;
  deptName: string;
  departmentType: number | null;
  children: Department[] | null;
}

//转换格式
export const convertToTreeSelectData = (departments: Department[]): any[] => {
  return departments.map(department => {
    const treeNode: any = {
      deptId: department.id,
      deptName: department.deptName,
      children: department.children ? convertToTreeSelectData(department.children) : undefined
    };
    return treeNode;
  });
}
